<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        img {
            /*行内元素垂直对齐方式:top上,middle中,bottom下,baseline基线*/
            vertical-align: middle;
        }
    </style>
</head>
<body>
    <input type="text"><img src="../b.jpg" style="width: 50px" alt="">
</body>
</html>